package com.c0der.neat;

public interface ActiveFunction {
    double active(double input);

    ActiveFunction relu = new ActiveFunction() {

        @Override
        public double active(double input) {
            return Math.max(0, input);
        }
    };

    ActiveFunction sigmod = new ActiveFunction() {
        @Override
        public double active(double input) {
            double ey = Math.pow(Math.E, -input);
            return 1 / (1 + ey);
        }
    };

    ActiveFunction tanh = new ActiveFunction() {

        @Override
        public double active(double input) {
            return Math.tanh(input);
        }
    };

}
